package UI.Ejercicio18;

import java.awt.Graphics;
import java.util.ArrayList;
import java.util.Collection;

import javax.swing.*;

public class MiPanel extends JPanel {
	private Collection<IFiguraGeometrica> cFiguras;
	JPanel botones;
	JPanel variables;
	Cuadrado panelCuadrado;
	private IFiguraGeometrica figura;
	private boolean verCirculos;
	private boolean verCuadrados;

	public MiPanel() {
		super();
		cFiguras = new ArrayList<IFiguraGeometrica>();
		verCirculos=true;
		verCuadrados=true;
		repaint();
	}

	public void addCuadrado(int coorX, int coorY) {
		
		cFiguras.add(new Cuadrado(coorX, coorY));
	}

	public void paint(Graphics g) {
		super.paint(g);
		for (IFiguraGeometrica f : cFiguras) {
			if (f instanceof Circulo && verCirculos
					|| f instanceof Cuadrado && verCuadrados) {
				f.dibujar(g);
			}
		}
	}

	public void pintar() {
		repaint();
	}

	public void addCirculo(int coorX, int coorY) {
		cFiguras.add(new Circulo(coorX, coorY));

	}

	public void switchCKCuadrados(boolean inte) {
		this.verCuadrados = inte;
		repaint();
	}

	public void switchCKCirculos(boolean inte) {

		this.verCirculos = inte;
		repaint();
	}
}
